package com.zbf.auth.user;

import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 作者: LCG
 * 日期: 2020/6/1 11:43
 * 描述:
 */

@Data
@Entity
@Table(name = "base_menu")
@EntityListeners(AuditingEntityListener.class)
public class Menu {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;

    @Column(name = "menuName")
    private String menuName;

    @Column(name = "code")
    private Long code;

    @Column(name = "parentCode")
    private Long parentCode;

    @Column(name = "imagePath")
    private String imagePath;

    @Column(name = "url")
    private String url;

    @Column(name = "leval")
    private int leval;

    @CreatedDate
    @Column(name = "createTime")
    private Date createTime;

    @LastModifiedDate
    @Column(name="updateTime")
    Date updateTime;

    @Version
    @Column(name = "version")
    private Long version;

    @Transient
    private List<Menu> listMenu;
}
